<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数定义方式2</title>
    <script type="text/javascript">
        /*
         * var 函数名 = function(){
         *     函数体
         * }
         */

        var fun = function () {
            alert("无参函数");
        };
        fun();

        var fun2 = function (a,b) {
            alert("有参函数a=" + a + ",b=" + b);
        };
        fun2(1,2);

        var fun3 = function (num1,num2) {
            return num1 + num2;
        };
        alert( fun3(100,200) );
    </script>
</head>
<body>

</body>
</html>